used by: java.time.format.DateTimeParseException: Text Fri Jan 07 13:37:48 EET 2022 could not be parsed at index 0

146

used by: java.time.format.DateTimeParseException: Text 'Fri Jan 07 13:37:48 EET 2022' could not be parsed at index 0 -

DateTimeFormatter df = new DateTimeFormatterBuilder()
    // case insensitive to parse JAN and FEB
    .parseCaseInsensitive()
    // add pattern
    .appendPattern("dd-MMM-yyyy")
    // create formatter (use English Locale to parse month names)
    .toFormatter(Locale.ENGLISH);

Comments

Submit
0 Comments